import Api from '@/utils/request';

const requestApi = new Api('http://localhost:3000/api');

export const getAll = () => {
    return requestApi.connection('get', '/user/getUser');
};

/**
 * 登录
 * @param {*} username
 * @param {*} password
 */
export const login = (username, password) => {
    const body = {
        username,
        password
    };
    return requestApi.connection('post', '/user/login', body);
};

/**
 * 展示推荐的博客
 * @param {*} currentPage
 * @param {*} size
 * @returns
 */
export const getAllRecommendBlog = (currentPage, size) => {
    return requestApi.connection('get', '/blog/showRecommend',  {
		currentPage: currentPage,
			size: size,
	});
};
